<?php

use yii\db\Migration;

/**
 * Class m190118_052039_add_furtherinfo_to_user
 */
class m190118_052039_add_furtherinfo_to_user extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('user', 'signature', $this->string(255));
        $this->addCommentOnColumn('user', 'signature', '个性签名');
        $this->addColumn('user', 'description', $this->string(255));
        $this->addCommentOnColumn('user', 'description', '个人简介');
        $this->addColumn('user', 'gender', $this->tinyInteger(3));
        $this->addCommentOnColumn('user', 'gender', '性别');
        $this->addColumn('user', 'real_name', $this->string(255));
        $this->addCommentOnColumn('user', 'real_name', '真实姓名');
        $this->addColumn('user', 'phone', $this->string(255));
        $this->addCommentOnColumn('user', 'phone', '联系电话');
        $this->addColumn('user', 'age', $this->tinyInteger(3));
        $this->addCommentOnColumn('user', 'age', '年龄');
        $this->addColumn('user', 'access_token', $this->string(255));
        $this->addCommentOnColumn('user', 'access_token', '存取令牌');
        $this->addColumn('user', 'wx_openid', $this->string(255));
        $this->addCommentOnColumn('user', 'wx_openid', '微信openid');
        $this->addColumn('user', 'wx_avatar', $this->string(255));
        $this->addCommentOnColumn('user', 'wx_avatar', '微信头像');
        $this->addColumn('user', 'wx_name', $this->string(255));
        $this->addCommentOnColumn('user', 'wx_name', '微信昵称');
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m190118_052039_add_furtherinfo_to_user cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m190118_052039_add_furtherinfo_to_user cannot be reverted.\n";

        return false;
    }
    */
}
